package com.lxy.dubbo.consumer;

import com.alibaba.dubbo.config.annotation.Reference;
import com.lxy.dubbo.api.service.HelloService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by michael on 4/3/2017.
 */

@Component
@RestController
public class Client {


    @Reference
    private HelloService helloService;

    public HelloService getHelloService() {
        return helloService;
    }

    public void setHelloService(HelloService helloService) {
        this.helloService = helloService;
    }

    @RequestMapping("/helloclient")
    public String hello(){
        return helloService.sayHello("123");

    }
}
